/***********************************************************************
 * Module:  ProfileImage.java
 * Author:  Voja
 * Purpose: Defines the Class ProfileImage
 ***********************************************************************/

package model.entity;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


@Entity
@Table(name = "profilimage")
public class ProfileImage implements Serializable{
   private static final long serialVersionUID = -107567262421393992L;

   @Id
   @GeneratedValue(strategy = IDENTITY)
   @Column(name = "profile_id", unique = true, nullable = false)
   private Integer id;
   
   @Column(name = "profile_location", unique = false, nullable = true)
   private String location;
   
   @Column(name = "profile_width", unique = false, nullable = true)
   private Integer width;
   
   @Column(name = "profile_height", unique = false, nullable = true)
   private Integer height;
   
   @Column(name = "profile_size", unique = false, nullable = true)
   private Integer size;
   
   @Temporal(TemporalType.TIMESTAMP)
   @Column(name = "profile_uploaddate", unique = false, nullable = true)
   private Date uploadDate;

	public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	public String getLocation() {
		return location;
	}
	
	public void setLocation(String location) {
		this.location = location;
	}
	
	public Integer getWidth() {
		return width;
	}
	
	public void setWidth(Integer width) {
		this.width = width;
	}
	
	public Integer getHeight() {
		return height;
	}
	
	public void setHeight(Integer height) {
		this.height = height;
	}
	
	public Integer getSize() {
		return size;
	}
	
	public void setSize(Integer size) {
		this.size = size;
	}
	
	public Date getUploadDate() {
		return uploadDate;
	}
	
	public void setUploadDate(Date uploadDate) {
		this.uploadDate = uploadDate;
	}
	
	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	public String toString() {
		return "ProfileImage [id=" + id + "]";
	}
   
	@Override
	public boolean equals(Object obj) {
		if(!(obj instanceof ProfileImage))
			return false;
		return ((ProfileImage)obj).getId().intValue()==getId().intValue();
	}
   
}